package com.ruoyi.common.enums;

/**
 * 运行异常枚举
 *
 * @author ByChen
 */
public enum RRExceptionCodeEnum {
    SUCCESS(200, "操作成功"),
    FAIL(500, "操作失败"),
    FAIL_FILE_SAVE(500, "保存失败"),
    IMPORT_FAIL(400, "导入失败"),
    PARAM_ERROR(500, "参数错误"),
    PARAM_REPEAT(500, "信息重复"),
    DATA_NOT_EXIST(500, "数据不存在"),
    DATA_IS_NULL(500, "数据为空"),
    NO_AUTHORITY(500, "无权限"),
    FILE_FORMAT_ERROR(500, "文件格式错误"),
    EXCEL_DATE_ERROR(500, "文件读取失败"),
    EXCEL_CONTENT_ERROR(500, "文件内容格式错误"),


    USER_HAS_EXTEND_INFO(500, "该账号下还有关联数据，无法删除"),
    USER_MOBILE_USED(500, "手机号已被注册"),
    USER_ID_CARD_USED(500, "身份证号已被注册"),
    MOBILE_FORMAT_ERR(500, "手机号格式错误"),
    // 系统信息
    SYS_ROLE_TEMP_TYPE_NAME_UNABLE_REPEAT(500, "名称不能重复"),
    SYS_ROLE_TEMP_TYPE_HAS_TEMP_UNABLE_REMOVE(500, "分类下有模板不支持删除"),
    SYS_ROLE_TEMP_MENU_NOT_EXIST(500, "菜单信息不存在"),
    SYS_ROLE_TEMP_MENU_PARENT_ID_UNABLE_SAME(500, "上级模板不能为模板本身"),
    SYS_ROLE_TEMP_NAME_UNABLE_REPEAT(500, "模板名称不能重复"),
    SYS_ROLE_TEMP_UNABLE_DOUBLE_CHILD(500, "同个模板下不允许被两个模板继承"),
    SYS_ROLE_TEMP_CHILD_MUST_CONTAIN_ALL_PARENT_MENU_ID(500, "必须包含上一级的菜单权限"),
    SYS_ROLE_TEMP_PARENT_MENU_ID_UNABLE_OVER_CHILD(500, "不能超出下一级的菜单权限内容"),
    SYS_ROLE_TEMP_HAS_CHILD_UNABLE_REMOVE(500, "存在下级模板，无法删除"),

    TENANT_USER_NAME_EXIST(500, "账号已存在"),

    USER_PASSWORD_EMPTY(500, "请输入密码"),


    DATE_FORMAT_ERROR(500, "日期格式错误"),

    ENT_DICT_VALUE_EXIST(500, "数据重复"),

    // aliyun文件上传
    ALIYUN_OSS_UPLOAD_NOT_EXIST(500, "文件信息不存在"),
    ALIYUN_OSS_UPLOAD_FAIL(500, "上传失败"),

    // 账号管理模块 操作异常 1100 开头异常
    USER_DELETE_FAIL_AS_HAVE_EXTEND_DATA(1101, "该账号下还有关联数据，无法删除"),

    //小程序登录
    API_TIME_OUT(401, "登录已过期，请重新登录！"),
    API_HAVE_NO_SESSION(401, "请求失败，请联系管理员"),
    ;


    /**
     * 错误编码
     */
    private final int code;

    /**
     * 错误信息
     */
    private final String message;

    RRExceptionCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
